package com.open.data.component.dao

import androidx.lifecycle.LiveData
import androidx.room.*
import com.open.data.component.data.Word


/**************************************************************
 *
 *
 *
 *
 * @author :guangjing.feng.o
 * @createTime: 2021/6/3.
 * @modifyTime:
 * @modifyAuthor:
 * @description:
 *
 ************************************************************/

@Dao
interface WordDao {

    @Insert
    fun insertWord(vararg words: Word?)

    @Update
    fun update(vararg words: Word?)

    @Delete
    fun delete(vararg words: Word?)

    @Query("DELETE FROM WORD")
    fun deleteAll()

    @Query("SELECT * FROM WORD ORDER BY ID DESC")
    fun getAll(): LiveData<List<Word?>?>?
}